/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package assignment2.stub;

import assignment2.data.Roles;
import assignment2.data.RolesFacade;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

/**
 *
 * @author tuan
 */
public class RolesTbl_Stub {
    RolesFacade rolesFacade = lookupRolesFacadeBean();

    public Roles searchByID(int RoleID){
        return rolesFacade.find(RoleID);
    }
    private RolesFacade lookupRolesFacadeBean() {
        try {
            Context c = new InitialContext();
            return (RolesFacade) c.lookup("java:global/Assignment2/Assignment2-ejb/RolesFacade!assignment2.data.RolesFacade");
        } catch (NamingException ne) {
            Logger.getLogger(getClass().getName()).log(Level.SEVERE, "exception caught", ne);
            throw new RuntimeException(ne);
        }
    }
    
}
